package com.sls.game.dao.nutsnet.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sls.game.dao.impl.SuperDAO;
import com.sls.game.dao.nutsnet.ChooseGemDAO;
import com.sls.game.pojo.nutsnet.ChooseGemInfo;

/**
 * 
 * @description choosegem信息DAO
 * @author Wangxuegang
 * @date 2012-11-2
 * 
 */
@Repository("chooseGemDAO")
public class ChooseGemDAOImpl extends SuperDAO<ChooseGemInfo> implements
		ChooseGemDAO {

	/**
	 * 记录插入
	 * 
	 * @param chooseGemInfo
	 */
	@Override
	public void insert(ChooseGemInfo chooseGemInfo) {
		this.getSqlSession().insert(
				"mybatis.xml.NutsNetChooseGemMapper.insert", chooseGemInfo);

	}

	/**
	 * 游戏赠品信息查询
	 * 
	 * @param chooseGemInfo
	 * @return
	 */
	@Override
	public List<ChooseGemInfo> queryGift(ChooseGemInfo chooseGemInfo) {
		List<ChooseGemInfo> list = null;
		list = this.getSqlSession().selectList(
				"mybatis.xml.NutsNetChooseGemMapper.queryGift", chooseGemInfo);

		return list;
	}

	@Override
	public List<ChooseGemInfo> queryOneOrMoreGift(ChooseGemInfo chooseGemInfo) {
		List<ChooseGemInfo> list = this.getSqlSession().selectList(
				"mybatis.xml.NutsNetChooseGemMapper.queryOneOrMoreRecord",
				chooseGemInfo);
		return list;
	}

	/**
	 * 删除记录
	 * 
	 * @param id
	 */
	@Override
	public void deleteById(String id) {
		this.getSqlSession().delete(
				"mybatis.xml.NutsNetChooseGemMapper.deleteById", id);
	}

}
